fix: publish command now packages manifest and provides manual upload instructions#315
Conversation
- PublishCommand now only updates manifest files, creates manifest.zip, and prints manual upload instructions (Agents > All agents > Upload custom agent) - Removed MOS Titles upload, token acquisition, and Graph API steps from publish - Removed --mos-env, --mos-token, --skip-graph options - Deleted AgentPublishService, MosTokenService, PublishHelpers (dead code) - Stripped MosConstants to PowerPlatform-only; removed internal TPS/MOS Titles app IDs, scope GUIDs, and service URLs - Removed dead MOS error message helpers from ErrorMessages - Updated PublishCommandTests to match new simplified signature and added zip creation test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused agentBlueprintService parameter from CreateCommand signature and its callsite in Program.cs (CR-001) - Replace magic-number zip cap (4) and arbitrary file padding loop with a clean LINQ expression over known candidate filenames (CR-002) - Remove dead --verbose option binding in publish command handler; startup- level --verbose in Program.cs continues to work (CR-003) - Add CHANGELOG [Unreleased] entry for the breaking behavior change (CR-004) - Remove redundant Console.SetIn call inside zip creation test; constructor already sets it (CR-005) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors a365 publish to stop performing automated MOS/Graph publishing and instead generate a manifest.zip for manual upload via the Microsoft 365 Admin Center, removing the associated MOS token acquisition and Graph publish workflow code.
Changes:
- Simplifies
a365 publishto update manifest IDs, createmanifest.zip, and print manual upload instructions. - Removes MOS token service, Graph publish service, and MOS prerequisite helper code along with their tests.
- Updates DI wiring and changelog to reflect the new publish behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs | Removes automated upload/Graph steps; updates manifests, creates zip, and prints manual upload instructions. |
| src/Microsoft.Agents.A365.DevTools.Cli/Program.cs | Removes AgentPublishService wiring and updates PublishCommand registration. |
| src/Microsoft.Agents.A365.DevTools.Cli/Constants/MosConstants.cs | Reduces constants to Power Platform-related entries (leaving a naming mismatch). |
| src/Microsoft.Agents.A365.DevTools.Cli/Constants/ErrorMessages.cs | Removes MOS-specific mitigation helpers that are no longer used. |
| src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/PublishCommandTests.cs | Updates tests and adds a success-path zip-creation test. |
| src/Microsoft.Agents.A365.DevTools.Cli/Services/MosTokenService.cs | Removed (MOS token acquisition/caching no longer used by publish). |
| src/Microsoft.Agents.A365.DevTools.Cli/Services/AgentPublishService.cs | Removed (Graph publish workflow no longer used by publish). |
| src/Microsoft.Agents.A365.DevTools.Cli/Helpers/PublishHelpers.cs | Removed (MOS prerequisites helper no longer used by publish). |
| src/Tests/.../MosTokenServiceTests.cs | Removed alongside MosTokenService. |
| src/Tests/.../MosTokenServiceCacheTests.cs | Removed alongside MosTokenService cache behavior. |
| src/Tests/.../AgentPublishServiceTests.cs | Removed alongside AgentPublishService. |
| src/Tests/.../PublishHelpersTests.cs | Removed alongside PublishHelpers. |
| CHANGELOG.md | Documents the changed a365 publish behavior under Unreleased. |
You can also share your feedback on Copilot code review. Take the survey.
src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Constants/PowerPlatformConstants.cs
Show resolved
Hide resolved
src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/Commands/PublishCommandTests.cs
Outdated
Show resolved
Hide resolved
Kept HEAD versions for PublishCommand.cs and Program.cs (our zip-only simplification). Kept deletion of MosTokenService.cs and MosTokenServiceTests.cs. Merged both CHANGELOG [Unreleased] entries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update Program.cs to use AzureAuthValidator directly (replaces removed IAzureValidator/AzureValidator), remove AzureWebAppCreator resolution, and pass authValidator to CleanupCommand - Delete MosPrerequisitesRequirementCheck and its test — this check wraps the deleted PublishHelpers and is no longer needed after the publish command was stripped to zip-only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace verbose section headers and wall-of-text guidance with a terse
column-aligned field list (version, name.short, name.full, descriptions,
developer.*, icons)
- Remove duplicate success messages; single 'Manifest updated: {path}' line
- Move per-file zip log entries to LogDebug
- Remove mixed Console.WriteLine / logger calls; output consistent through logger
- Add blank line after interactive prompt block before 'Package created:'
- Fix column alignment: replace 'color.png / outline.png' key with 'icons'
- Add name.short > 30 char warning
- Remove unused logger parameters from UpdateManifestFileAsync and
UpdateAgenticUserManifestTemplateFileAsync
- Update tests: remove Console.SetIn workarounds that are no longer needed
for early-exit paths; add WithDisplayNameExceeding30Chars_LogsWarning test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
File and class name no longer reflect their contents after MOS upload infrastructure was removed. The remaining constants relate solely to the Power Platform API (CopilotStudio permissions), so rename to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
You can also share your feedback on Copilot code review. Take the survey.
src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Agents.A365.DevTools.Cli/Commands/PublishCommand.cs
Outdated
Show resolved
Hide resolved
- Delegate zip creation to ManifestTemplateService.CreateManifestZipAsync, removing duplicate inline implementation and aligning file list with the service's canonical set (fixes comments #1 and #2) - Move per-file zip log entries to LogDebug in ManifestTemplateService so the command output remains terse - Fix --dry-run option description: "without writing files or creating the zip" (fixes comment #3) - Handle null/empty displayName in name.short guidance with explicit warning instead of printing currently: "" (fixes comment #4) - Update test class summary to reflect current Console.In redirect approach (fixes comment #6) - Fix CHANGELOG: interactive prompts occur only in interactive terminals; stdin redirect suppresses them in scripts (fixes comment #7) - Comment #5 (PowerPlatformConstants summary) already resolved by prior rename Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove all references to the internal MOS (Microsoft Online Services) Titles service that were left over after PR #315 stripped the upload logic from the publish command. - Rewrite DEVELOPER.md publish section to reflect zip-only workflow - Update README.md, design.md, and subdirectory READMEs accordingly - Remove dead MOS error codes from ErrorCodes.cs and ErrorMessages.cs - Update deprecation messages in CreateInstanceCommand and A365CreateInstanceRunner - Fix comment in PermissionsSubcommand referencing "MOS Power Platform API" - Remove stale MosConstants, MosTokenService, AgentPublishService, PublishHelpers entries from README docs (those files no longer exist) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove all references to the internal MOS (Microsoft Online Services) Titles service that were left over after PR #315 stripped the upload logic from the publish command. - Rewrite DEVELOPER.md publish section to reflect zip-only workflow - Update README.md, design.md, and subdirectory READMEs accordingly - Remove dead MOS error codes from ErrorCodes.cs and ErrorMessages.cs - Update deprecation messages in CreateInstanceCommand and A365CreateInstanceRunner - Fix comment in PermissionsSubcommand referencing "MOS Power Platform API" - Remove stale MosConstants, MosTokenService, AgentPublishService, PublishHelpers entries from README docs (those files no longer exist) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
a365 publishnow updates manifest IDs, createsmanifest.zip, and prints step-by-step instructions for uploading via the Microsoft 365 Admin CenterWhy
Separating the manifest packaging step from the upload step simplifies the publish workflow, removes external service dependencies, and aligns the CLI with the standard Microsoft 365 Admin Center agent upload experience.
Manual upload instructions (new flow)
After running
a365 publish, users are prompted to:https://admin.microsoft.com)manifest.zipDetailed instructions: https://learn.microsoft.com/en-us/copilot/microsoft-365/agent-essentials/agent-lifecycle/agent-upload-agents
🤖 Generated with Claude Code